<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title></title>
    <!-- 使用swiper: 要引入swiper的css文件 -->
    <link rel="stylesheet" href="swiper.css" />
    <style type="text/css">
      * {
        padding: 0;
        margin: 0;
        list-style: none;
        border: 0;
      }

      .all {
        width: 500px;
        height: 300px;
        padding: 7px;
        border: 1px solid #ccc;
        margin: 100px auto;
        position: relative;
      }

      .screen {
        width: 500px;
        height: 300px;
        overflow: hidden;
        position: relative;
      }

      .screen li {
        width: 500px;
        height: 300px;
        overflow: hidden;
        float: left;
      }

      .screen ul {
        position: absolute;
        left: 0px;
        top: 0px;
        width: 3000px;
      }

      .all ol {
        position: absolute;
        right: 10px;
        bottom: 10px;
        line-height: 20px;
        text-align: center;
      }

      .all ol li {
        float: left;
        width: 20px;
        height: 20px;
        background: #fff;
        border: 1px solid #ccc;
        margin-left: 10px;
        cursor: pointer;
      }

      .all ol li.current {
        background: yellow;
      }

      #arr {
        /* display: none; */
        z-index: 1000;
      }

      #arr span {
        width: 40px;
        height: 40px;
        position: absolute;
        left: 5px;
        top: 50%;
        margin-top: -20px;
        background: #000;
        cursor: pointer;
        line-height: 40px;
        text-align: center;
        font-weight: bold;
        font-family: '黑体';
        font-size: 30px;
        color: #fff;
        opacity: 0.3;
        border: 1px solid #fff;
      }

      #arr #right {
        right: 5px;
        left: auto;
      }
    </style>
  </head>

  <body>
    <div class="all" id="box">
      <div class="screen swiper-container" id="screen">
        <ul class="swiper-wrapper">
          <li class="swiper-slide">
            <img src="images/w1.jpeg" width="500" height="300" />
          </li>
          <li class="swiper-slide">
            <img src="images/w2.jpeg" width="500" height="300" />
          </li>
          <li class="swiper-slide">
            <img src="images/w3.jpeg" width="500" height="300" />
          </li>
          <li class="swiper-slide">
            <img src="images/w4.jpeg" width="500" height="300" />
          </li>
          <li class="swiper-slide">
            <img src="images/w5.jpeg" width="500" height="300" />
          </li>
        </ul>
        <ol class="swiper-pagination"></ol>
      </div>
      <div id="arr">
        <span id="left" class="swiper-button-prev"></span>
        <span id="right" class="swiper-button-next"></span>
      </div>
    </div>
    <!-- 使用swiper: 要引入swiper的js文件 -->
    <script src="swiper.js"></script>
    <script>
      // 初始化swiper
      // new Swiper('.swiper-container')
      new Swiper('.swiper-container', {
        // 配置轮播图的效果

        // 无缝效果
        loop: true,

        // 滑动方向
        // direction: 'vertical'

        // //即slider滑动开始到结束的时间
        speed: 1000,

        // // 自动播放
        autoplay: {
          //自动播放间隔时间
          delay: 1000,

          //用户操作swiper之后，是否禁止autoplay。默认为true：停止。
          disableOnInteraction: false,
        },

        // // 切换效果
        // effect: 'fade',

        // // 左右箭头
        navigation: {
          nextEl: '.swiper-button-next',
          prevEl: '.swiper-button-prev',
        },

        // // 小圆点
        pagination: {
          el: '.swiper-pagination',
          //此参数设置为true时，点击分页器的指示点分页器会控制Swiper切换。
          clickable: false,
        },
      })
    </script>
  </body>
</html>
